﻿<%@ Page Title="Oversigt af venner" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ListFriends.aspx.cs" Inherits="RLAWEB.ListFriends" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        .friendList {
            border: 1px solid #ff8c00;
            background-color: #d3d3d3;
            margin-bottom: 5px;
            width: 500px;
        }

        .info {
            width: 100px;
            padding: 3px;
        }
    </style>
    <h2><%: Title %>.</h2>
    <h3>Her er listen over dine venner.</h3>

    <asp:Repeater ID="ListFriendsRepeater" runat="server">
        <ItemTemplate>
            <table class="friendList">
                <tr>
                    <td class="info">
                        <b>Navn:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblFirstName" runat="server" Text='<%#Eval("FirstName") %>'></asp:Label>
                        <asp:Label ID="lblLastName" runat="server" Text='<%#Eval("LastName") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="info">
                        <b>E-post:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblEmail" runat="server" Text='<%#Eval("Email") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="info">
                        <b>Køn:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblGender" runat="server" Text='<%#Eval("Gender") %>'></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="info">
                        <b>Brugernavn:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblProfileName" runat="server" Text='<%#Eval("ProfileName") %>'></asp:Label>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    <hr/>
    <h3>Venneanmodninger.</h3>

    <asp:Repeater ID="AcceptFriends" runat="server">
        <ItemTemplate>
            <table class="friendList">
                <tr>
                    <td class="info">
                        <b>Navn:</b>
                    </td>
                    <td>
                        <asp:Label ID="lblFirstName" runat="server" Text='<%#Eval("FirstName") %>'></asp:Label>
                        <asp:Label ID="lblLastName" runat="server" Text='<%#Eval("LastName") %>'></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnAcceptFriend" runat="server" PostBackUrl='<%# String.Format("/ListFriends?ID={0}", Eval("UserId")) %>' Text='<%#Eval("UserId") %>' OnPreRender="btnAcceptFriend_Load" OnClick="btnAcceptFriend_Click" />
                        <asp:Label ID="lblPendingFriend" runat="server" Text='<%#Eval("UserId") %>' OnPreRender="lblPendingFriend_Load"></asp:Label>
                        <%--<div id="PendingFriend">Afventer</div>--%>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    
<%--    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT DISTINCT [fName], [lname], [email], [gender], [profileName] FROM [DBUser]"></asp:SqlDataSource>--%>
</asp:Content>